// 模块名字，ref值
export const moduleRefName = [
  'basicInformation',
  'complaintSatisfaction',
  'serviceOrder',
  'propertyCharges',
  'securityControl',
  'equipmentEnergy',
  'warehouseInformation',
  'staffAttendance',
  'equipmentInformation',
  'patrolAnalysis',
  'employeeReport',
  'stockAssets',
  'assetsHandling',
  'stockDistribution',
  'assetsDistribution',
  'overviewOfThePark',
  'projectPicture',
  'parkEnvironmentalIndex',
  'parkServiceSystem',
  'businessIncubationInParks',
  'talentIntroduction',
  'industryDistribution',
  'trendOfParkService',
  'distributionOfIncomeScale',
  'taxScaleDistribution',
  'patentDistributionInPark',
  'customerSatisfaction',
  'overallOfThePark',
  'videoSurveillance',
  'personnelAccessDetails',
  'energyConsumptionInPark',
  'parkParkingDetails',
  'parkVehicleStatistics',
  'campusMonitoringWarning',
  'warningOfThePark',
  'operationOverview',
  'operatingIncomeOfThePark',
  'overviewOfRentalIncome',
  'parkServiceSystemInner',
  'annualRentalTrend',
  'mission',
  'leasingResources',
  'GoalAttainment',
  'RentalIncomeTrend',
  'CurrentYearLeaseTrend',
  'goalsAchieved',
  'vacancyInTheYear',
  'CurrentYearContractChanges'
]

// 组件html名字和引入名称,返回格式{htmlArray: [basic-information, ...], htmlNameTemplate: {'basic-information': 'BasicInformation', ...}}
export function moduleHtmlName () {
  let htmlArray = []
  let htmlNameTemplate = {}
  let c = ''
  let htmlNameStr = ''
  // 获取名ref的名字,
  moduleRefName.forEach((item, index) => {
    htmlNameStr =
      item.substring(0, 1).toUpperCase() + item.substring(1, item.length)
    for (let i = 0; i < htmlNameStr.length; i++) {
      c = item.charAt(i)
      // 查找哪一个是大小字母，但有大写字母的时候，html的时候，大写字母X（参数）需要转化为 -x, 组件引入的时候，需要组件第一个字母是大写
      if (c >= 'A' && c <= 'Z') {
        item = item.replace(c, '-' + c.toLowerCase())
      }
    }
    htmlNameTemplate[item] = htmlNameStr
    htmlArray.push(item)
  })
  return { htmlArray, htmlNameTemplate }
}
